import type { PatientItem, PatientParams } from '@/types/patient'
import { request } from '@/utils/request'

// 添加患者
export const addPatientApi = (data: PatientParams) => {
  return request.post('/patient/add', data)
}

// 获取患者列表
export const patientListApi = () => {
  return request.get<any, PatientItem[]>('/patient/mylist')
}

// 删除患者
export const removePatientApi = (id: string) => {
  return request.delete(`/patient/del/${id}`)
}

// 更新患者
export const updatePatientApi = (data: { id: string } & PatientParams) => {
  return request.put('/patient/update', data)
}

// 获取患者详情
export const getPatientDetailApi = (id: string) => {
  return request.get<any, PatientItem>(`/patient/info/${id}`)
}
